package com.bank.backend.boot.server.converter;


import com.bank.backend.boot.base.model.dto.UserDTO;
import com.bank.backend.boot.base.model.entity.User;
import com.bank.backend.boot.base.model.vo.UserVO;
import com.bank.backend.boot.server.annotation.MappingIgnore;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author jiaowei
 * @since 2025/3/29 21:35
 */
@Mapper(componentModel = "spring")
public interface UserConverter {
    UserConverter INSTANCE = Mappers.getMapper(UserConverter.class);

    UserVO convert(User user);

    List<UserVO> convert(List<User> users);

    Page<UserVO> convert(Page<User> users);

    @MappingIgnore
    User convert(UserDTO userDTO);

}
